package ranks.types;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Team {
	
	private static Map<List<String>, Team> teams = new HashMap<List<String>, Team>();
	
	public final static Team ARIZONA_CARDINALS = new Team("Arizona Cardinals","ARI","","6");
	public final static Team ATLANTA_FALCONS = new Team("Atlanta Falcons","ATL","","8");
	public final static Team BALTIMORE_RAVENS = new Team("Baltimore Ravens","BAL","","8");
	public final static Team BUFFALO_BILLS = new Team("Buffalo Bills","BUF","","6");
	public final static Team CAROLINA_PANTHERS = new Team("Carolina Panthers","CAR","","6");
	public final static Team CHICAGO_BEARS = new Team("Chicago Bears","CHI","","8");
	public final static Team CINCINNATI_BENGALS = new Team("Cincinnati Bengals","CIN","","6");
	public final static Team CLEVELAND_BROWNS = new Team("Cleveland Browns","CLE","","8");
	public final static Team DALLAS_COWBOYS = new Team("Dallas Cowboys","DAL","","4");
	public final static Team DENVER_BRONCOS = new Team("Denver Broncos","DEN","","9");
	public final static Team DETROIT_LIONS = new Team("Detroit Lions","DET","","7");
	public final static Team GREEN_BAY_PACKERS = new Team("Green Bay Packers","GB","GBP","10");
	public final static Team HOUSTON_TEXANS = new Team("Houston Texans","HOU","","7");
	public final static Team INDIANAPOLIS_COLTS = new Team("Indianapolis Colts","IND","","7");
	public final static Team JACKSONVILLE_JAGUARS = new Team("Jacksonville Jaguars","JAC","JAX","9");
	public final static Team KANSAS_CITY_CHIEFS = new Team("Kansas City Chiefs","KC","KAN","4");
	public final static Team MIAMI_DOLPHINS = new Team("Miami Dolphins","MIA","","5");
	public final static Team MINNESOTA_VIKINGS = new Team("Minnesota Vikings","MIN","","4");
	public final static Team NEW_ENGLAND_PATRIOTS = new Team("New England Patriots","NE","","5");
	public final static Team NEW_ORLEANS_SAINTS = new Team("New Orleans Saints","NO","NOS","10");
	public final static Team NEW_YORK_GIANTS = new Team("New York Giants","NYG","","8");
	public final static Team NEW_YORK_JETS = new Team("New York Jets","NYJ","","7");
	public final static Team OAKLAND_RAIDERS = new Team("Oakland Raiders","OAK","","10");
	public final static Team PHILADELPHIA_EAGLES = new Team("Philadelphia Eagles","PHI","","8");
	public final static Team PITTSBURGH_STEELERS = new Team("Pittsburgh Steelers","PIT","","5");
	public final static Team SAN_DIEGO_CHARGERS = new Team("San Diego Chargers","SD","SDE","10");
	public final static Team SAN_FRANCISCO_49ERS = new Team("San Francisco 49ers","SF","SFO","9");
	public final static Team SEATTLE_SEAHAWKS = new Team("Seattle Seahawks","SEA","","5");
	public final static Team ST_LOUIS_RAMS = new Team("St. Louis Rams","STL","","9");
	public final static Team TAMPA_BAY_BUCCANEERS = new Team("Tampa Bay Buccaneers","TB","TAM","4");
	public final static Team TENNESSEE_TITANS = new Team("Tennessee Titans","TEN","","9");
	public final static Team WASHINGTON_REDSKINS = new Team("Washington Redskins","WAS","","9");
	public final static Team FREE_AGENTS = new Team("Free Agents","FA","F/A","0");

	private String name;
	private String shortA;
	private String shortB;
	private String byeWeek;
	
	private Team(String name, String shortA, String shortB, String byeWeek) {
		this.name = name;
		this.shortA = shortA;
		this.shortB = shortB;
		this.byeWeek = byeWeek;
		
		if(this.shortB.equals(""))
			this.shortB = this.shortA;
		
		Team.teams.put(Team.getTeamKey(this), this);
	}
	
	public static Team getTeam(String teamShort) {
		Team team = null;
		
		for(List<String> shorts : Team.teams.keySet()) {
			if(shorts.contains(teamShort)) {
				team = Team.teams.get(shorts);
			}
		}
		
		return team;
	}

	public String getName() {
		return this.name;
	}

	public String getShortA() {
		return this.shortA;
	}

	public String getShortB() {
		return this.shortB;
	}

	public String getByeWeek() {
		return this.byeWeek;
	}
	
	public static List<String> getTeamKey(Team team) {
		List<String> teamKey = new ArrayList<String>();
		teamKey.add(team.getShortA());
		teamKey.add(team.getShortB());
		
		return teamKey;
	}
	
	
}
